package club.lovety.oauth2.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 这里写文档描述
 *
 * @author smc
 * @date 2018-08-24 13:57
 * @since
 */
@RestController
@RequestMapping("userresource")
@Secured({"ROLE_ADMIN"})
public class UserResourceController {

    private static final Logger log = LoggerFactory.getLogger(UserResourceController.class);

    @RequestMapping("getuser")
    public Object getUser(Authentication  authentication){
        log.info("====接收资源请求=======");
        authentication.getDetails();
        return "你获取了值";
    }

}
